<template>
  <div>
    <page-banner v-if="showBanner && bannerPosition==='top'" ref="pageBanner" :banner-setting="bannerSetting" />
    <table-filter
      ref="tableFilter"
      is-in-template
      :query="filter"
      :query-rows="queryRows"
      :enable-full-search="fullTextSearch"
      :search-type.sync="searchType"
      :search-text.sync="searchText"
      :grid-info="gridInfo"
      @search="handleSearch"
      @reset="handleSearch"
    />
    <div class="filter-wraper">
      <table-operate is-in-template :btns="toolbarBtns" :show-back="showBack">
        <template v-if="showBack" #back="{size}">
          <span class="btn-wraper">
            <el-button type="primary" :size="size" icon="el-icon-back" @click="goBack">返回</el-button>
          </span>
        </template>
      </table-operate>
    </div>
    <slot-render name="tabs" />
    <lb-table
      v-loading="listLoading"
      v-bind="tableAttr"
      :column="tableColumn"
      :data="tableData"
      :table-info="tableInfo"
      :grid-info="gridInfo"
      :personalization="personalization"
      :btns="tableBtns"
      :pagination="enablePaging"
      background
      border
      is-template
      layout="total, sizes, prev, pager, next, jumper"
      :page-sizes="pageSizes"
      :current-page.sync="currentPage"
      :total="total"
      :page-size="pageSize"
      fixed-heigth
      :default-sort="defaultSort"
      @size-change="handleSizeChange"
      @p-current-change="handleCurrentChange"
      @sort-change="handleSortChange"
    />
    <page-banner v-if="showBanner && bannerPosition==='bottom'" ref="pageBanner" :banner-setting="bannerSetting" />
  </div>
</template>

<script>
import main from './mixins/main'
import table from './mixins/table'
import filter from './mixins/filter'
import banner from './mixins/banner'
import baseForm from '@admin/packages/table-operate/src/baseForm'
function getTemplateMixin() {
  console.log(window.page_011302)
  return window.page_011302 || {}
}
export default {
  name: 'Tem1101',
  extends: baseForm,
  mixins: [main, filter, table, getTemplateMixin(), banner],
  data() {
    return {
    }
  },
  mounted: function() {
    this.getList()
  },
  methods: {
    onActivated: function() {
      this.getList()
    }
  }
}
</script>
<style lang="scss" scoped>
::v-deep .form-operate{
  display: inline-block;
  margin-right: 10px;
}
</style>
